Align ArrayWindows trait impls with Windows#151613
Merged
rust-bors[bot] merged 5 commits intorust-lang:mainfrom Feb 9, 2026
Merged
Align ArrayWindows trait impls with Windows#151613rust-bors[bot] merged 5 commits intorust-lang:mainfrom
ArrayWindows trait impls with Windows#151613rust-bors[bot] merged 5 commits intorust-lang:mainfrom
Conversation
The derived `T: Copy` constraint is not appropriate for an iterator by reference, but we generally do not want `Copy` on iterators anyway.
This implementation doesn't need the derived `T: Clone`.
Member
|
The minimal fix would seem to be to backport an unstabling PR, then let these changes ride the train as normal. |
Member
Author
Member
|
Given the number of missed things, it seems clear that this feature did not receive enough attention before it was stabilized. That's why I think unstabilizing is the most principled solution. Beta is the least used/tested release channel so backporting like this feels awfully close to committing straight to stable ;P. These changes seem straightforward enough, but the changes that end up causing problems often seem so as well... |
Member
Author
|
r? Amanieu |
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 9, 2026
…anieu Align `ArrayWindows` trait impls with `Windows` With `slice::ArrayWindows` getting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared to `slice::Windows`, and I think we should align these. - Remove `derive(Copy)` -- we generally don't want `Copy` for iterators at all, as this is seen as a footgun (e.g. rust-lang#21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiring `T: Copy`. - Manually `impl Clone`, simply to avoid requiring `T: Clone`. - `impl FusedIterator`, because it is trivially so. The `since = "1.94.0"` assumes we'll backport this, otherwise we should change that to the "current" placeholder. - `impl TrustedLen`, because we can trust our implementation. - `impl TrustedRandomAccess`, because the required `__iterator_get_unchecked` method is straightforward. r? libs-api @rustbot label beta-nominated (at least for the `Copy` removal, but we could be more selective about the rest).
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 9, 2026
…anieu Align `ArrayWindows` trait impls with `Windows` With `slice::ArrayWindows` getting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared to `slice::Windows`, and I think we should align these. - Remove `derive(Copy)` -- we generally don't want `Copy` for iterators at all, as this is seen as a footgun (e.g. rust-lang#21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiring `T: Copy`. - Manually `impl Clone`, simply to avoid requiring `T: Clone`. - `impl FusedIterator`, because it is trivially so. The `since = "1.94.0"` assumes we'll backport this, otherwise we should change that to the "current" placeholder. - `impl TrustedLen`, because we can trust our implementation. - `impl TrustedRandomAccess`, because the required `__iterator_get_unchecked` method is straightforward. r? libs-api @rustbot label beta-nominated (at least for the `Copy` removal, but we could be more selective about the rest).
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 9, 2026
…anieu Align `ArrayWindows` trait impls with `Windows` With `slice::ArrayWindows` getting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared to `slice::Windows`, and I think we should align these. - Remove `derive(Copy)` -- we generally don't want `Copy` for iterators at all, as this is seen as a footgun (e.g. rust-lang#21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiring `T: Copy`. - Manually `impl Clone`, simply to avoid requiring `T: Clone`. - `impl FusedIterator`, because it is trivially so. The `since = "1.94.0"` assumes we'll backport this, otherwise we should change that to the "current" placeholder. - `impl TrustedLen`, because we can trust our implementation. - `impl TrustedRandomAccess`, because the required `__iterator_get_unchecked` method is straightforward. r? libs-api @rustbot label beta-nominated (at least for the `Copy` removal, but we could be more selective about the rest).
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 9, 2026
…anieu Align `ArrayWindows` trait impls with `Windows` With `slice::ArrayWindows` getting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared to `slice::Windows`, and I think we should align these. - Remove `derive(Copy)` -- we generally don't want `Copy` for iterators at all, as this is seen as a footgun (e.g. rust-lang#21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiring `T: Copy`. - Manually `impl Clone`, simply to avoid requiring `T: Clone`. - `impl FusedIterator`, because it is trivially so. The `since = "1.94.0"` assumes we'll backport this, otherwise we should change that to the "current" placeholder. - `impl TrustedLen`, because we can trust our implementation. - `impl TrustedRandomAccess`, because the required `__iterator_get_unchecked` method is straightforward. r? libs-api @rustbot label beta-nominated (at least for the `Copy` removal, but we could be more selective about the rest).
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 9, 2026
…anieu Align `ArrayWindows` trait impls with `Windows` With `slice::ArrayWindows` getting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared to `slice::Windows`, and I think we should align these. - Remove `derive(Copy)` -- we generally don't want `Copy` for iterators at all, as this is seen as a footgun (e.g. rust-lang#21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiring `T: Copy`. - Manually `impl Clone`, simply to avoid requiring `T: Clone`. - `impl FusedIterator`, because it is trivially so. The `since = "1.94.0"` assumes we'll backport this, otherwise we should change that to the "current" placeholder. - `impl TrustedLen`, because we can trust our implementation. - `impl TrustedRandomAccess`, because the required `__iterator_get_unchecked` method is straightforward. r? libs-api @rustbot label beta-nominated (at least for the `Copy` removal, but we could be more selective about the rest).
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 9, 2026
Rollup of 12 pull requests Successful merges: - #152388 (`rust-analyzer` subtree update) - #151613 (Align `ArrayWindows` trait impls with `Windows`) - #152134 (Set crt_static_allow_dylibs to true for Emscripten target) - #152166 (cleanup some more things in `proc_macro::bridge`) - #152236 (compiletest: `-Zunstable-options` for json targets) - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented) - #142957 (std: introduce path normalize methods at top of `std::path`) - #145504 (Add some conversion trait impls) - #152131 (Port rustc_no_implicit_bounds attribute to parser.) - #152315 (fix: rhs_span to rhs_span_new) - #152327 (Check stalled coroutine obligations eagerly) - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 9, 2026
Rollup of 12 pull requests Successful merges: - #152388 (`rust-analyzer` subtree update) - #151613 (Align `ArrayWindows` trait impls with `Windows`) - #152134 (Set crt_static_allow_dylibs to true for Emscripten target) - #152166 (cleanup some more things in `proc_macro::bridge`) - #152236 (compiletest: `-Zunstable-options` for json targets) - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented) - #142957 (std: introduce path normalize methods at top of `std::path`) - #145504 (Add some conversion trait impls) - #152131 (Port rustc_no_implicit_bounds attribute to parser.) - #152315 (fix: rhs_span to rhs_span_new) - #152327 (Check stalled coroutine obligations eagerly) - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 9, 2026
Rollup of 12 pull requests Successful merges: - #152388 (`rust-analyzer` subtree update) - #151613 (Align `ArrayWindows` trait impls with `Windows`) - #152134 (Set crt_static_allow_dylibs to true for Emscripten target) - #152166 (cleanup some more things in `proc_macro::bridge`) - #152236 (compiletest: `-Zunstable-options` for json targets) - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented) - #142957 (std: introduce path normalize methods at top of `std::path`) - #145504 (Add some conversion trait impls) - #152131 (Port rustc_no_implicit_bounds attribute to parser.) - #152315 (fix: rhs_span to rhs_span_new) - #152327 (Check stalled coroutine obligations eagerly) - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
rust-timer
added a commit
that referenced
this pull request
Feb 9, 2026
Rollup merge of #151613 - cuviper:array-windows-parity, r=Amanieu Align `ArrayWindows` trait impls with `Windows` With `slice::ArrayWindows` getting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared to `slice::Windows`, and I think we should align these. - Remove `derive(Copy)` -- we generally don't want `Copy` for iterators at all, as this is seen as a footgun (e.g. #21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiring `T: Copy`. - Manually `impl Clone`, simply to avoid requiring `T: Clone`. - `impl FusedIterator`, because it is trivially so. The `since = "1.94.0"` assumes we'll backport this, otherwise we should change that to the "current" placeholder. - `impl TrustedLen`, because we can trust our implementation. - `impl TrustedRandomAccess`, because the required `__iterator_get_unchecked` method is straightforward. r? libs-api @rustbot label beta-nominated (at least for the `Copy` removal, but we could be more selective about the rest).
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 12, 2026
[beta] backports, plus stable versions in stdarch - Replace `stdarch` version placeholders with 1.94 - Parse ident with allowing recovery when trying to diagnose #151249 - Revert enabling `outline-atomics` on various platforms #151896 - Revert doc attribute parsing errors to future warnings #151952 - Remove the 4 failing tests from rustdoc-gui #152194 - Remove rustdoc GUI flaky test #152116 - Align `ArrayWindows` trait impls with `Windows` #151613 - Fix suppression of `unused_assignment` in binding of `unused_variable` #151556 - layout: handle rigid aliases without params #151814 - Fix missing unused_variables lint when using a match guard #151990 - Partially revert "resolve: Update `NameBindingData::vis` in place" #152498 - [BETA]: parse array lengths without stripping const blocks #152237 r? cuviper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
slice::ArrayWindowsgetting ready to stabilize in 1.94, I noticed that it currently has some differences in trait implementations compared toslice::Windows, and I think we should align these.derive(Copy)-- we generally don't wantCopyfor iterators at all, as this is seen as a footgun (e.g. remove Copy impls from remaining iterators #21809). This is obviously a breaking change though, so we should only remove this if we also backport the removal before it's stable. Otherwise, it should at least be replaced by a manual impl without requiringT: Copy.impl Clone, simply to avoid requiringT: Clone.impl FusedIterator, because it is trivially so. Thesince = "1.94.0"assumes we'll backport this, otherwise we should change that to the "current" placeholder.impl TrustedLen, because we can trust our implementation.impl TrustedRandomAccess, because the required__iterator_get_uncheckedmethod is straightforward.r? libs-api
@rustbot label beta-nominated
(at least for the
Copyremoval, but we could be more selective about the rest).